<style>
    .input-readonly{background-color:#eee;}
    .layui-table td, .layui-table th{padding:6px 8px;}
</style>
<form class="layui-form" action="{:url()}" method="post" id="editForm">
    <div class="layui-form-item">
    <div class="layui-inline upload" style="width:280px; padding-left:30px;">
        <button type="button" name="upload" class="layui-btn layui-btn-primary layui-upload" lay-type="image" lay-data="{exts:'jpg|png|gif|bmp|jpeg', accept:'images'}">请上传产品图</button>
        <input type="hidden" class="upload-input" name="pic" value="">

        <img src="" style="display:none;border-radius:5px;border:1px solid #ccc" width="36" height="36">
    </div>
    </div>
    {:FormExt::input('订单号', 'client_ordernum', '', '订单号', '', '')}
    <div class="pop-bottom-bar">
        <input type="hidden" class="field-id" name="id">
        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit" hisi-data="{pop: true, refresh: false}">提交保存</button>
        <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
    </div>
</form>
{include file="system@block/layui" /}
<script src="__PUBLIC_JS__/jquery.2.1.4.min.js?v={:config('hisiphp.version')}"></script>
<script src="__PUBLIC_JS__/xm-select/dist/xm-select.js?v={:config('hisiphp.version')}"></script>
<script>
    layui.use(['form', 'func', 'jquery', 'upload', 'layer', 'tool'], function() {
        $ = layui.jquery;
        var form = layui.form;
        var laytpl = layui.laytpl, laydate = layui.laydate, table = layui.table;
        var upload = layui.upload;
        var layer = layui.layer;

        upload.render({
            elem: '.layui-upload',
            url: '{:url("system/annex/upload?thumb=no&water=no&full_path=true")}'
            , method: 'post'
            , before: function (input) {
                layer.msg('文件上传中...', {time: 3000000});
            }, done: function (res, index, upload) {
                var obj = this.item;
                if (res.code == 0) {
                    layer.msg(res.msg);
                    return false;
                }
                layer.closeAll();
                var input = $(obj).parents('.upload').find('.upload-input');
                if ($(obj).attr('lay-type') == 'image') {
                    input.siblings('img').attr('src', res.data.file).show();
                }
                input.val(res.data.file);
            }
        });
    });
</script>